package com.bjtu.laorenyouhao.yigong.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.bjtu.common.valid.ListValue;
import com.bjtu.common.valid.group.AddGroupp;
import com.bjtu.common.valid.group.UpdateGroup;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * 义工信息表
 * 
 * @author yangyalong
 * @email yangyalong@gmail.com
 * @date 2021-07-08 21:02:42
 */
@Data
@TableName("yig_yigong_info")
public class YigongInfoEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * id
	 */
	@TableId
	@NotNull(message = "修改时必须指定义工id",groups = {UpdateGroup.class})
	@Null(message = "新增不能指定义工id",groups = {AddGroupp.class})
	private Long id;
	/**
	 * 姓名
	 */
	@NotBlank(message = "姓名不能为空",groups = {AddGroupp.class, UpdateGroup.class})
	private String name;
	/**
	 * 性别
	 */
	@NotNull(groups =  {AddGroupp.class})
	@ListValue(vals={0,1},groups = {AddGroupp.class})
	private Integer gender;
	/**
	 * 电话
	 */
	@NotBlank(groups = {AddGroupp.class})
	private String phone;
	/**
	 * 身份证
	 */
	@NotBlank(groups = {AddGroupp.class})
	private String idCard;
	/**
	 * 出生日期
	 */
	@NotNull(groups = {AddGroupp.class})
	private Date birth;
	/**
	 * 图像目录
	 */
	private String imgsetDir;
	/**
	 * 头像路径
	 */
	@NotBlank(groups = {AddGroupp.class})
	@URL(message = "头像必须是一个合法的url",groups = {UpdateGroup.class,AddGroupp.class})
	private String profilePhoto;
	/**
	 * 描述
	 */
	private String description;
	/**
	 * 删除标志
	 */
	@TableLogic
	@NotNull(groups =  {AddGroupp.class})
	@ListValue(vals={0,1},groups = {AddGroupp.class})
	private Integer isRemove;

}
